﻿using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for EditEventWindow.xaml
    /// </summary>
    public partial class TAV33SPLIT
    {

        public TAV33SPLIT()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VICC_MKRF();
            DataContext = MV;
            InitializeComponent();
        } 

        private void LoadMKRF(object sender, RoutedEventArgs e)
        {

            TMV.VKK.UVKK04(null);
            dwData = TBMain.NewRow();
            dwData["ABFMANDANT"] = app.Mandant;
            dwData["ABFKSTKRS"] = KSTKRS;
            dwData["ABFKST"] = KST;
            dwData["ABFAGANG"] = AGANG;
            dwData["MKFERLKZ"] = " ";
            dwData["ABFAUFLFD"] = " AND JOBTYPE<>'C' AND ABFAUFLFD LIKE '" + LFD + "%'";
            SResult = TMV.QTMKRF08(dwData);
            MergeData(SResult, true, true);
        } 
         
        private void SplitJobCommand(object sender, RoutedEventArgs e)
        {
            TMV.SplitJob(dwMKRF, SQTY);
        }

        private void SplitAllCommand(object sender, RoutedEventArgs e)
        {
            IsBusy = true;
            TMV.IsRestart = true;
            TMV.AutoSplit();
            IsBusy = false;
        }
    }
}
